package com.hsd.netty.server.decoder;

import com.hsd.netty.server.model.RequestObject;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * @author s.he
 * on 2020/6/1
 */
@Deprecated
public class MessageObjectDecoder extends MessageToMessageDecoder<RequestObject> {
    private static final Logger logger = LoggerFactory.getLogger(MessageObjectDecoder.class);

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, RequestObject requestObject, List<Object> list) throws Exception {
        logger.info("MessageObjectDecoder.decode:" + requestObject.getClassName());
        list.add(requestObject);
    }
}
